package cn.edu.ujn.shi.service;

import cn.edu.ujn.shi.dao.UserMapper;
import cn.edu.ujn.shi.dao.User;
import cn.edu.ujn.shi.dao.UserType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements IUserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> getAll() {
        return userMapper.getAll();
    }

    @Override
    public List<User> getRepeat(User user) {
        return userMapper.getRepeat(user);
    }

    @Override
    public List<User> getUser(String username) {
        if (username == null) {
            username = "";
        }
        return userMapper.getUser(username);
    }

    @Override
    public void updateUser(User user) {
        userMapper.updateUser(user);
    }

    @Override
    public void insert(User user) {
        userMapper.insert(user);
    }

    @Override
    public void delete(String username) {
        userMapper.delete(username);
    }

}
